package com.eksboot.proxy.dynamic2;

import com.eksboot.proxy.Target;
import com.eksboot.proxy.TargetImpl;

import java.util.ArrayList;
import java.util.List;

/**
 * DynamicProxyTest
 *
 * @author: chenfenghai
 * @version: 1.0
 * @date: 2021-05-25 14:52
 */
public class DynamicProxyTest2 {

    public static void main(String[] args) {
        List<Interceptor> interceptorList = new ArrayList<>();
        interceptorList.add(new LogInterceptor());
        interceptorList.add(new TransactionInterceptor());

        Target target = new TargetImpl();
        Target targetProxy = (Target) TargetProxy.wrap(target,interceptorList);
        targetProxy.execute(" HelloWord ");
    }
}
